﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="PictureHot.aspx.cs" Inherits="PictureHot" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
<title>Thập cẩm, website hài huớc- vui vẻ</title>
     <meta name="title" content="thập cẩm, website hài huớc- vui vẻ" />
        <meta name="description" content="cuời, hài hước ,vui vẻ, cuời đau bụng" />
        <meta name="keywords" content="cuời, hài, vui cuời, cuời sảng khoái" />
        <meta name="geo.placename" content="Ho Chi Minh City" />
        <link rel="canonical" href="http://thapcam.vn/Anh-hai.html" />
        <meta property="og:site_name" content="thapcam.vn" />
        <meta property="fb:app_id" content="425283504281234" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<script>    (function (d, s, id) {
        var js, fjs = d.getElementsByTagName(s)[0];
        if (d.getElementById(id)) return;
        js = d.createElement(s); js.id = id;
        js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=425283504281234";
        fjs.parentNode.insertBefore(js, fjs);
    } (document, 'script', 'facebook-jssdk'));


    window.fbAsyncInit = function () {
        FB.init({
            appId: '425283504281234',
            status: true, // check login status
            cookie: true, // enable cookies to allow the server to access the session
            xfbml: true // parse XFBML
        });
        FB.Event.subscribe('edge.create', function (href, widget) {

            $.ajax({
                type: "post",
                async: true,
                url: "<%=userHost %>/Proccess/UpdateLikeFacebook.aspx?val=like",
                data: { href: href }
            });
        });
        FB.Event.subscribe('edge.remove', function (href, widget) {

            $.ajax({
                type: "post",
                async: true,
                url: "<%=userHost %>/Proccess/UpdateLikeFacebook.aspx?val=unlike",
                data: { href: href }
            });
        });
    }
    
    </script>

    <script type="text/javascript">

        var button;
        var userInfo;

        (function (d, s, id) {
            var js, fjs = d.getElementsByTagName(s)[0];
            if (d.getElementById(id)) return;
            js = d.createElement(s); js.id = id;
            js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
            fjs.parentNode.insertBefore(js, fjs);
        } (document, 'script', 'facebook-jssdk'));

        window.fbAsyncInit = function () {
            FB.init({
                appId: 425283504281234,
                status: true, // check login status
                cookie: true, // enable cookies to allow the server to access the session
                xfbml: true, // parse XFBML
                oauth: true
            });
            function updateButton(response) {
                button = document.getElementById('fb-auth');
                userInfo = document.getElementById('user-info');

                if (response.authResponse) {

                    FB.api('/me', function (info) {
                        login(response, info);
                    });

                    button.onclick = function () {
                        FB.logout(function (response) {
                            logout(response);
                        });
                    };
                } else {

                    LoginFacebook();
                }
            }
            FB.getLoginStatus(updateButton);
            FB.Event.subscribe('auth.statusChange', updateButton);
        };
        function login(response, info) {

            if (response.authResponse) {
                var accessToken = response.authResponse.accessToken;
                var avatar = 'https://graph.facebook.com/' + info.id + '/picture';
                $('#imgAvatar').attr("src", avatar);
                InsertAccount(info.name, info.email, avatar);
            }
        }

        function InsertAccount(username, email, avatar) {
            $.ajax({
                type: "post",
                url: "<%=userHost %>/Proccess/ProccessInsertAccount.aspx",
                async: false,
                data: { username: username, email: email, avatar: avatar },
                success: function (data2) {
                    if (data2 == "insertsuccess") {
                        // window.location.href = "<%=userHost %>/UploadPicture.aspx";
                    }

                }
            });
        }

        function LoginFacebook() {

            FB.login(function (response) {
                if (response.authResponse) {
                    FB.api('/me', function (info) {
                        login(response, info);
                    });
                } else {
                    //user cancelled login or did not grant authorization

                }
            }, { scope: 'email,user_birthday,status_update,publish_stream,user_about_me' });
        }
    </script>

    <div class="row">

                    <!-- Bread Crumb Start -->
                    <%--<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                        <ol class="breadcrumb">
                            <li><a href="javascript:;">Cười Haha</a></li>
                            <li class="active">Xem Gì</li>
                        </ol>
                    </div>--%>
                    <!-- Bread Crumb End -->
                                       
                    <!-- Content Column Start -->
                    <div class="col-lg-7 col-md-12 col-sm-12 col-xs-12 equalcol conentsection col-lg-push-4">

                        <!-- Contents Section Started -->
                        <div class="sections">

                            <div id="divListSubject" class="row">
                            <%
         List<DBAccess.Object.Subject> lstSubject = DBAccess.Business.SubjectBusiness.GetListAllSubjectVideosVisible(1,1, 0, 3);
                                int totalRecordPage = 0;
                                if (lstSubject != null && lstSubject.Count > 0)
                                {
                                    string linkSubject = "";
                                    totalRecordPage = lstSubject.Count;
                                    string description = "", imageSubject = "";
                                    string title = "", author = "";
                                    int view = 1, comment = 1;
                                    int vt = 0;
                                    string createDate = "";
                                    foreach (DBAccess.Object.Subject subject in lstSubject)
                                    {
                                        if (!string.IsNullOrEmpty(subject.Content))
                                        {
                                            description = HttpUtility.HtmlDecode(subject.Content);
                                            description = description.Replace("<p>", "").Replace("</p>", "");
                                        }
                                        author = subject.AuthorName;
                                        view = subject.TotalView;
                                        comment = subject.TotalComment;
                                        imageSubject = modHost + subject.ImagePath;
                                        createDate = Utilitys.ConvertToTimeVietName(subject.CreateDate);
                                        linkSubject = Utilitys.sefSubjectLink(subject.ID, subject.Title);
                                 %>
                                <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                                    <div class="videobox2 blogposttwo">
                                        <div class="text title-def">
                                            <h2><a href="<%=linkSubject %>"><%=title %></a></h2>
                                            <ul class="tip-info">
                                                <li><i class="fa fa-user"></i> <strong><%=author %></strong> <small><%=createDate %></small> </li>
                                                <li><i class="fa fa-eye"></i><strong><%=view %></strong> <small>lượt xem</small></li>
                                                <li><i class="fa fa-comments"></i><strong><%=comment %></strong> <small>thích</small></li>
                                            </ul>
                                        </div>

                                        <figure>
                                           <a href="<%=linkSubject %>" target="_blank" title="<%=subject.Title %>">
					                        <%
                                                if (subject.TypeSubject==2)
                                                {
                                                    %>
					                                <img src="<%=imageSubject %>" style="width:564px; height:390px" />
                  
                            
                                                    <%
                                                }
                                                else
                                                {
                                                %>
                                                 <img src="<%=imageSubject %>" style="width:564px;" />
                                                <%
                                                }
                                            %>
                                            </a>
                                        </figure>
                                         <%
                                    if (subject.TypeSubject==2)
                                    {
                                        %>
                                          <a href="<%=linkSubject %>" target="_blank" title="<%=subject.Title %>" style="float:left">
                                            <div class="iconPlay"></div>
                                        </a>
                                        <%
                                    }   
                                 %>

                                        <div class="text">
                                     
                                   <div style="float:left; width:50%; padding-top:12px;"><div class="fb-like" data-href="<%=linkSubject %>" data-layout="button_count" data-action="like" data-show-faces="true" data-share="true"></div></div>
                                          
                                            <a href="javascript:;" onclick="ShowFormCommet('<%=subject.ID %>')" class="btn btn-primary backcolor alignright"><i class="fa fa-group">&nbsp;</i>Bình Luận</a>
                                        </div>
                                        <div class="text" id="divComment<%=subject.ID %>" style="display:none">
                                        <div class="fb-comments" data-href="<%=linkSubject %>" data-numposts="3" data-colorscheme="light"></div>
                                        </div>
                                       
                                    </div>
                                    <div class="clearfix"></div>
                                    <hr />
                                </div>
                                <%
}
}
                                     %>
                                      <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                      <div id="divLoading" style="float:left; width:100%; display:none; margin-top:-25px; text-align:center">
                      <img src="images/loading.gif" />
                      </div>
                      </div>
                            </div>
                        </div>
                        <!-- Contents Section End -->
                        <div class="clearfix"></div>

                    </div>
                    <!-- Content Column End -->

                    <!-- Gray Sidebar Start -->
                    <div class="col-lg-3 col-md-12 col-sm-12 col-xs-12 equalcol graysidebar col-lg-pull-7">

                        <div class="widget">
                                                                                                  
                            <div class="categorieslist user-cate-list">
                                <ul>
                                    <li><a href="javascript:;"><i class="fa fa-bar-chart-o"></i> Kênh của tôi</a> </li>
                                    <li> <a href="javascript:;"><i class="fa fa-sign-in"></i> Đăng ký của tôi</a> </li>
                                    <li> <a href="javascript:;"><i class="fa fa-video-camera"></i> Lịch sử đã xem</a> </li>
                                    <li> <a href="javascript:;"><i class="fa fa-flag"></i> Duyệt qua kênh</a> </li>
                                </ul>
                            </div>
                        </div>
                        <div class="clearfix"></div>
                        
                        <!-- Interactive Tabs Widget start -->
                    <div class="widget">
                            <div class="interactivetabs">
                                <!-- Nav tabs -->
                                <ul class="nav nav-tabs" id="intertabs">
                                    <li class="active"><a href="#twittertab" data-toggle="tab"><i class="fa fa-film"></i>Clip Hot</a></li>
                                    <li><a href="#blogtab" data-toggle="tab"><i class="fa fa-picture-o"></i>Ảnh Hot</a></li>
                                    <li><a href="#abouttab" data-toggle="tab"><i class="fa fa-user"></i>Top User</a></li>
                                </ul>
                                <!-- Tab panes -->
                                <div class="tab-content">
                                    <!-- Twitter Tab Start -->
                                    <div class="tab-pane fade in active" id="twittertab">
                                        <div class="videolistsmall">
                                            <ul class="bloglist">
                                                    <%
                List<DBAccess.Object.Subject> lstVideo = DBAccess.Business.SubjectBusiness.GetListAllSubjectVideosVisibleMostView(1, 2, 0, 6);
                if (lstVideo != null && lstVideo.Count > 0)
                {
                    string linkVideo = "", imageVideo = "";
                    foreach (DBAccess.Object.Subject subject in lstVideo)
                    {
                        linkVideo = Utilitys.sefSubjectLink(subject.ID, subject.Title);
                        imageVideo = modHost + subject.ImagePath;
                                     %>
                                    <li>
                                        <div class="media">
                                            <a href="<%=linkVideo %>" title="<%=subject.Title %>" class="pull-left">
                                                <img class="media-object img-responsive hovereffect" style="width:90px; height:67px" src="<%=imageVideo %>" alt="<%=subject.Title %>" />
                                            </a>
                                            <div class="media-body">
                                                <h5><a href="<%=linkVideo %>" title="<%=subject.Title %>"><%=subject.Title %></a></h5>
                                                <ul>
                                                    <li><i class="fa fa-eye"></i> <%=subject.TotalView %></li>
                                                     <li><i class="fa fa-comment"></i> <%=subject.TotalLike %></li>
                                                </ul>
                                            </div>
                                        </div>
                                    </li>
                                   
                                   <%
                     }
                }
                                         %>


                                            </ul>
                                        </div>
                                    </div>
                                    <!-- Twitter Tab End -->
                                    <!-- Blog Tab Start -->
                                    <div class="tab-pane fade" id="blogtab">
                                        <div class="videolistsmall">
                                            <ul class="bloglist">
                                                    <%
                List<DBAccess.Object.Subject> lstImage = DBAccess.Business.SubjectBusiness.GetListAllSubjectVideosVisibleMostView(1, 1, 0, 6);
                if (lstImage != null && lstImage.Count > 0)
                {
                    string linkVideo = "", imageVideo = "";
                    foreach (DBAccess.Object.Subject subject in lstImage)
                    {
                        linkVideo = Utilitys.sefSubjectLink(subject.ID, subject.Title);
                        imageVideo = modHost + subject.ImagePath;
                                     %>
                                    <li>
                                        <div class="media">
                                            <a href="<%=linkVideo %>" title="<%=subject.Title %>" class="pull-left">
                                                <img class="media-object img-responsive hovereffect" style="width:90px; height:67px" src="<%=imageVideo %>" alt="<%=subject.Title %>" />
                                            </a>
                                            <div class="media-body">
                                                <h5><a href="<%=linkVideo %>" title="<%=subject.Title %>"><%=subject.Title %></a></h5>
                                                <ul>
                                                    <li><i class="fa fa-eye"></i> <%=subject.TotalView %></li>
                                                     <li><i class="fa fa-comment"></i> <%=subject.TotalLike %></li>
                                                </ul>
                                            </div>
                                        </div>
                                    </li>
                                   
                                   <%
                     }
                }
                                         %>

                                            </ul>
                                        </div>
                                    </div>
                                    <!-- Blog Tab End -->
                                    <!-- Video List Tab Start -->
                                    <div class="tab-pane fade" id="abouttab">
                                        <div class="videolistsmall">
                                            <ul class="bloglist">
                                                    <%
                List<DBAccess.Object.Subject> lstUser = DBAccess.Business.SubjectBusiness.GetListAllSubjectVideosVisibleMostView(1, 1, 0, 6);
                if (lstUser != null && lstUser.Count > 0)
                {
                    string linkVideo = "", imageVideo = "";
                    foreach (DBAccess.Object.Subject subject in lstUser)
                    {
                        linkVideo = Utilitys.sefSubjectLink(subject.ID, subject.Title);
                        imageVideo = modHost + subject.ImagePath;
                                     %>
                                    <li>
                                        <div class="media">
                                            <a href="<%=linkVideo %>" title="<%=subject.Title %>" class="pull-left">
                                                <img class="media-object img-responsive hovereffect" style="width:90px; height:67px" src="<%=imageVideo %>" alt="<%=subject.Title %>" />
                                            </a>
                                            <div class="media-body">
                                                <h5><a href="<%=linkVideo %>" title="<%=subject.Title %>"><%=subject.Title %></a></h5>
                                                <ul>
                                                    <li><i class="fa fa-eye"></i> <%=subject.TotalView %></li>
                                                     <li><i class="fa fa-comment"></i> <%=subject.TotalLike %></li>
                                                </ul>
                                            </div>
                                        </div>
                                    </li>
                                   
                                   <%
                     }
                }
                                         %>

                                            </ul>
                                        </div>
                                    </div>
                                    <!-- Video List Tab End -->
                                </div>
                            </div>
                        </div>
                        <div class="clearfix"></div>
                        <!-- Interactive Tabs Widget End --> 

                        <!-- Advertisement start -->
                        <div class="widget">
                            <img src="images/adv2.gif" class="img-responsive" alt="">
                        </div>
                        <div class="clearfix"></div>
                        <!-- Advertisement End -->
                        
                        <!-- Recent Post Widget start -->
                        <div class="widget left-share">
                            <h2 class="help-block">Kết nối với Thapcam.vn</h2>
                            <div class="text">
                                <a href="javascript:;" class="btn btn-primary btn-sm"><i class="fa fa-thumbs-up"></i>&nbsp;Like</a>
                                <a href="javascript:;" class="btn btn-primary btn-sm"><i class="fa fa-facebook"></i>&nbsp;Share</a>
                              
                            </div>
                        </div>
                        <div class="clearfix"></div>
                        <!-- Recent Post Widget end -->

                    </div>
                    <!-- Gray Sidebar End -->


                    
                </div>
                <input type="hidden" id="hdPage" value="2" />
                <script type="text/javascript">
                    $(window).scroll(function (e) {
                        var top = window.scrollY;
                        var heightDivScroll0 = 0;

                        var topBody = $('.sections').position().top;
                        var heightBody = $('.sections').height();
                        var totalHeight = parseInt(heightBody) - 750;
                        var page = $('#hdPage').val();
                      
                        if (top > totalHeight) {
                            $('#divLoading').css("display", "block");
                            $.ajax({
                                type: "post",
                                async: false,
                                url: "<%=userHost %>/Proccess/LoadPicturePage.aspx",
                                data: { page: page },
                                success: function (data2) {

                                    var newPage = parseInt(page) + 1;
                                    $('#hdPage').val(newPage);
                                    $('#divLoading').css("display", "none");
                                    $('#divListSubject').append(data2);
                                    FB.XFBML.parse();
                                }
                            });
                        }
                        else {
                            $('#divLoading').css("display", "none");
                        }
                    });
                    function ShowFormCommet(id) {
                        var divComment = "#divComment" + id;
                        $(divComment).css("display", "block");
                    }
                </script>
</asp:Content>

